{% extends "base_generic.html" %}

{% block content %}
  <h1>所有借出的书籍</h1>
  {% if borrowed_books %}
    <ul>
      {% for bookinst in borrowed_books %}
        <li class="{% if bookinst.is_overdue %}text-danger{% endif %}">
          <a href="{% url 'book-detail' bookinst.book.pk %}">{{ bookinst.book.title }}</a>
          (应归还: {{ bookinst.due_back }})
          - 借阅人: <strong>{{ bookinst.borrower.get_username }}</strong>
          {% if perms.catalog.can_mark_returned %}
            <a href="{% url 'renew-book-librarian' bookinst.id %}">续借</a>
          {% endif %}
        </li>
      {% endfor %}
    </ul>
  {% else %}
    <p>当前没有借出的书籍。</p>
  {% endif %}
{% endblock %}